<template>
  <div>
      <div class = "sousuo">
        用户编号: <i-input v-model="userId" placeholder="请输入..." style="width: 300px"></i-input>
        <i-button type="primary" shape="circle" icon="ios-search" @click="getListInfo"></i-button>
      </div>
      <Row class="body">
        <i-col span="4">记录编号</i-col>
        <i-col span="4">动账用户编号</i-col>
        <i-col span="4">用户收益金额</i-col>
        <i-col span="4">动账类型</i-col>
        <i-col span="4">金额来源用户编号</i-col>
        <i-col span="4">操作时间</i-col>
      </Row>

      <Row class="list" v-for="(item) of userList" :key="item.name">
        <i-col span="4">{{item.id}}&nbsp; </i-col>
        <i-col span="4">{{item.userId}}</i-col>
        <i-col span="4">{{item.money}}</i-col>
        <i-col v-if="item.type==1" span="4">提现</i-col>
        <i-col v-else-if="item.type==2" span="4">购买pos机</i-col>
        <i-col v-else-if="item.type==13" span="4">本人刷卡</i-col>
        <i-col v-else-if="item.type==14" span="4">徒弟刷卡</i-col>
        <i-col v-else-if="item.type==4" span="4">立即办卡奖励</i-col>
        <i-col v-else span="4">其他</i-col>
        <i-col span="4">{{item.fromUserId}}</i-col>
        <i-col span="4">{{item.time}}</i-col>
      </Row>

    <div class="page">
      <Page :total="total" :page-size="pageSize" @on-change="handlePage"></Page>
    </div>
  </div>

</template>

<script>
import axios from 'axios'
export default {
  name: 'YhsyjlList',
  data () {
    return {
        pageSize:10,
        pageNumber:1,
        total:0,
        userList:'',
        self: this,
        userId:'',
      }
  },
  methods: {
    getListInfo () {
      axios.post('/web/api/manager/yhuy',{"pageSize":this.pageSize,"page":this.pageNumber,"userId":this.userId}).then(this.getListInfoSucc)
    },
    getListInfoSucc (res) {
      console.log('tag', res)
      this.total = res.data.date.total
      this.userList = res.data.date.list
    },
    handlePage (res){
      axios.post('/web/api/manager/yhuy',{"pageSize":this.pageSize,"page":res,"userId":this.userId}).then(this.getListInfoSucc)
    },
  },
  mounted () {
    this.getListInfo();
  }
}
</script>
<style lang="stylus" scoped>
  .body
    width: 100%
    line-height 3
    font-size 14px
    color #2680c4
    background #eff3fa
    text-align center
  .list
    line-height 3
    font-size 14px
    text-align center
    color #2680c4
  .sousuo
    width 100%
    text-align center
    margin-top 2rem
    margin-bottom 2rem
  .page
    width 100%
    margin-top 2rem
    text-align center
</style>

